package com.community.itelligentcommunity.community.myCommunity.controller;


import com.community.itelligentcommunity.common.base.controller.GenericController;
import com.community.itelligentcommunity.common.base.service.GenericService;
import com.community.itelligentcommunity.community.myCommunity.entity.Praise;
import com.community.itelligentcommunity.community.myCommunity.entity.QueryPraise;
import com.community.itelligentcommunity.community.myCommunity.service.PraiseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/praise")

public class PraiseController extends GenericController<Praise, QueryPraise> {


    @Autowired
    private PraiseService praiseService;


    @Override
    protected GenericService<Praise, QueryPraise> getService() {
        return praiseService;
    }

    @Override
    public String addPage() throws Exception {
        return "community/myCommunity/Praise/add";
    }

    @Override
    public String updatePage(Praise entity, Model model) throws Exception {
        entity = getService().get(entity);
        model.addAttribute("entity", entity);
        return "community/myCommunity/Praise/update";
    }

}
